package chapter05.e6;

public class e6 {
    public static void main(String[] args) {
        String str = "石家庄-武汉-哈尔滨";
        System.out.println(str.substring(4));
        System.out.println(str.substring(4, 6));
        String[] strArray = str.split("-");
        for (int i = 0; i < strArray.length; i++) {
            if (i != strArray.length - 1) {
                System.out.println(strArray[i] + ",");
            } else {
                System.out.println(strArray[i]);
            }
        }
    }
}
